﻿@using System.Linq.Expressions;
@using Microsoft.AspNetCore.Authorization;
@using Microsoft.Extensions.Logging
@using ThingsGateway.Admin.Application;
@using ThingsGateway.Admin.Razor
@using ThingsGateway.Extension
@using ThingsGateway.Gateway.Application
@using BootstrapBlazor.Components
@using ThingsGateway.Plugin.DB
@namespace ThingsGateway.Plugin.QuestDB


<AdminTable TItem="QuestDBNumberHistoryValue" AutoGenerateColumns="true" ShowDefaultButtons=false
            AllowResizing="true" IsFixedHeader=true IsMultipleSelect=false
            ShowExtendEditButton=false ShowExtendDeleteButton=false ShowExtendButtons=false
            ShowExportButton="true" IsAutoQueryFirstRender=false
            OnQueryAsync="OnQueryAsync" IsPagination=true CustomerSearchModel="@CustomerSearchModel">
    <CustomerSearchTemplate>
        @if (context is SqlDBPageInput model)
        {
            @Render(model)
        }
    </CustomerSearchTemplate>

</AdminTable>

@code {
    RenderFragment Render(SqlDBPageInput model) =>
    @<div class="row form-inline g-2">
        <div class="col-12 ">
            <BootstrapInput @bind-Value="model.DeviceName" ShowLabel="true" />
        </div>
        <div class="col-12 ">
            <BootstrapInput @bind-Value="model.VariableName" ShowLabel="true" />
        </div>
        <div class="col-12 ">
            <DateTimeRange @bind-Value="model.SearchDate" ShowLabel="true" />
        </div>
    </div>;

}
